#include<stdio.h>
#include<string.h>
#include<fcntl.h>
#include<unistd.h>
#include<sys/stat.h>
#include<stdlib.h>

int main(int argc, char *argv[])
{
	int fd;
	int len;
	char *data;

	char *path = argv[1];
	fd = open(path,O_RDONLY);
	if(fd < 0)
	{
		printf("can't find file named:%s\n",path);
		return 0;
	}
	len = lseek(fd,0,SEEK_END);
	data = (char *)malloc(len+1);
	lseek(fd,0,SEEK_SET);
	read(fd,data,len);
	close(fd);
	printf("%s",data);
	return 0;
}
